/**
 * @author changke
 */
var currentWidth = 0;

function hideBrowserBar() {
	if(window.innerHeight < (window.outerHeight + 20)) {
		$("html").css({"min-height": (window.outerHeight + 20) + "px"});
	}
	setTimeout(function() {
		window.scrollTo(0, 1);
	}, 100);
}

function updateLayout() {
	if(window.innerWidth != currentWidth) {
		currentWidth = window.innerWidth;
		setTimeout(hideBrowserBar, 0);
	}
}

function initPage4iPhone() {
	var url = location.href;
	if(url.indexOf("#comments") < 0) {
		hideBrowserBar();
	}
	document.body.addEventListener("orientationchange", updateLayout);
}
